import request from '@/utils/request'

//获取文档目录列表
export function getFolders() {
  return request({
    url: '/folder',
    method: 'get'
  })
}

// 创建文档目录
export function createFolder(params) {
  return request({
    url: '/folder',
    method: 'post',
    params: params
  })
}
// 删除文档目录
export function deleteFolder(params) {
  return request({
    url: '/folder',
    method: 'delete',
    params: params
  })
}

export function renameFolder(params) {
  return request({
    url: '/folder/rename',
    method: 'put',
    params: params
  })
}

// 获取上传文档token
export function getUpdateDocToken() {
  return request({
    url: '/document/update_token',
    method: 'get'
  })
}

// 获取全部文档列表
export function getDocuments(params) {
  return request({
    url: '/document',
    method: 'get',
    params: params
  })
}

export function getDocumentPage(params) {
  return request({
    url: '/document/page',
    method: 'get',
    params: params
  })
}

// 删除文件
export function deleteDocument(params) {
  return request({
    url: '/document',
    method: 'delete',
    params: params
  })
}

// 重命名文件
export function renameDocument(params) {
  return request({
    url: '/document/rename',
    method: 'put',
    params: params
  })
}
